import Router from "koa-router";
import registerOperate from "./operate";
import registerProject from "./project";
import registerSnapshot from "./snapshot";

const routerFn = (fn: Function) => (ctx: Context) => fn(ctx, ctx.state.params);

const router = new Router();

router.prefix("/api");

registerOperate(router, routerFn);

registerProject(router, routerFn);

registerSnapshot(router, routerFn);

export default router;
